<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <c:set var="ctx" value="${pageContext.request.contextPath}"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>修改短信设置</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<div class="Wrapper">
    <form id="formSet1">
        <div class="fieldset1 tabel_col clearFix">
            <div class="fieldBox col_100_auto">
                <div class="label">任务处理提醒</div>
                <div class="field">
                    <input name="flowId" id="flowId" type="hidden" value="${flowId}">
                    <input name="isFlowOpen" id="isFlowOpen" type="hidden" value="${isOpen}">

                    <input name="isOpen" id="isOpenCd" type="radio"
                           <c:if test="${isOpen!=1}">checked</c:if> value="0">关闭
                    <input name="isOpen" id="isOpenCd1" type="radio"
                           <c:if test="${isOpen==1}">checked</c:if> value="1">开通
                </div>
            </div>
        </div>
    </form>
</div>


<script type="text/javascript">
    $(function () {
        var formSet1 = $('#formSet1').ligerForm({
            validate: true
        });
    });
    frameElement.dialog.onOk = function () {
        save();
    }
    frameElement.dialog.onCancel = function () {
        frameElement.dialog.close();
    }


    function save() {
        var form = liger.get("formSet1");
        if (!form.valid()) {
            top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
            return false;
        }
        var isOpenCd = $('input[name="isOpen"]:checked ').val();
        var _id = $("#flowId").val();

        $.ajax({
            type: 'post',
            dataType: 'json',
            data: {
                id: _id,
                isOpen: isOpenCd
            },
            url: '<%=path%>/notice/sysFlowNoticeCfg/modify.do',
            beforeSend: function () {
                wait_dialog = top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
            },
            success: function (msg) {
                wait_dialog.close();
                if (msg.success == 1) {
                    top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                    frameElement.dialog.close();
                } else {
                    top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                }
            }
        });
    }

</script>


</body>
</html>
